<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>处理用户输入</title>
	<script src="lib/js/vue.js"></script>
</head>
<body>
	<div id="app1">
		<p>{{ message }}</p>
		<button v-on:click="reverseMessage">Reverse Message</button>
	</div>

	<script>
		new Vue({
			el: '#app1',
			data: {
				message: '123 4567 8'
			},
			methods: {								//methods用来定义方法
				reverseMessage: function() {
					this.message = this.message.split('').reverse().join('')
				}
			}
		})
	</script>
</body>
</html>